package com.haihui.platform.controller.sys;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.haihui.platform.controller.BaseController;
import com.haihui.platform.entity.CommArea;
import com.haihui.platform.service.sys.CommAreaService;

/**
 * Created by HaiHui on 2017/10/17.
 */
@Controller
@RequestMapping(value="/area")
public class commonAreaController extends BaseController{
    private static final Logger LOG = Logger.getLogger(SysAdUserController.class);
    @Autowired
    CommAreaService areaService;


    @RequestMapping(value = "/townList")
    public void townList(){
        try{
            List<CommArea> list = areaService.townList();
            if(list.size() > 0){
                this.responseWriter(this.getCommonJsonString(true,"查询成功",list));
            }else{
                this.responseWriter(this.getCommonJsonString(false,"查询失败"));
            }

        }catch (Exception e){
            e.printStackTrace();
        }

    }

}
